package com.example.mybatis.dao;

import com.example.mybatis.moudle.Bookkeeping;
import com.example.mybatis.moudle.Output;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BookkeepingDao {
    /**
     * 查找所有并输出
     * @return 列表
     */
    List<Bookkeeping> findAll();

    List<Bookkeeping> findByFlag(Integer flag);

    /**
     * 按支付方式查找(微信,支付宝,现金)
     * @param method
     * @return
     */
    List<Bookkeeping> selectByMethod(String method);

    List<Bookkeeping> selectByMethodFlag(String method,Integer flag);

    /**
     * 按种类(零食,水果,服饰...)查询
     * @param kind
     * @return
     */
    List<Bookkeeping> selectByKind(String kind);

    /**
     * 按月查找
     * @param month
     * @return
     */
    List<Bookkeeping> selectByMonth(Integer year, Integer month);

    /**
     * 按月查找收入/支出
     * @param year 年份
     * @param month 月份
     * @param flag 1收入,2支出
     * @return
     */
    List<Bookkeeping> selectByMonthFlag(Integer year, Integer month,Integer flag);

    /**
     * 按年查找
     * @param year
     * @return
     */
    List<Bookkeeping> selectByYear(Integer year);

    int deleteByPrimaryKey(Integer id);

    int insert(Bookkeeping record);

    int insertSelective(Bookkeeping record);

    Bookkeeping selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Bookkeeping record);

    int updateByPrimaryKey(Bookkeeping record);
}